home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 8542 / 8542.xpi / chrome / lastpass.jar / content / selectpasswords.js < prev    next >
Text File  |  2010-02-14  |  3KB  |  12 lines

  1. var importaccounts=new Array();var showingPasswords=false;var fromwelcome=false;var forceall=false;function SignonsStartup(){var A=window.arguments;if(A.length>0){fromwelcome=A[0]}if(A.length>1){forceall=A[1]}if(forceall){document.getElementById("importCol").setAttribute("editable",false);document.getElementById("selectAll").setAttribute("hidden",true);
  2. document.getElementById("unselectAll").setAttribute("hidden",true)}var B=document;B.title=LP.lpgs(forceall?"View Passwords to Import":"Select Passwords to Import");LP.sr(B,"siteCol","label","Site");LP.sr(B,"userCol","label","Username");LP.sr(B,"passwordCol","label","Password");LP.sr(B,"importCol","label","Import?");
  3. LP.sr(B,"selectAll","label","Select All");LP.sr(B,"unselectAll","label","Unselect All");LP.sr(B,"togglePasswords","label","Show Passwords");LP.sr(B,"signonsIntro","value",forceall?"Below are the passwords that will be imported into LastPass":"Please select the passwords you would like to import into LastPass");
  4. LP.sr(B,"importBtn","label","Import");LP.sr(B,"cancelBtn","label","Cancel");LoadSignons()}function LoadSignons(){importaccounts=LP.lpImportFirefoxPasswords();var B=document.getElementById("signonsTreeChildren");for(var F=0;F<importaccounts.length;F++){var G=document.createElement("treeitem");var H=document.createElement("treerow");
  5. var E=document.createElement("treecell");E.setAttribute("editable","false");E.setAttribute("label",importaccounts[F].url);H.appendChild(E);var D=document.createElement("treecell");D.setAttribute("editable","false");D.setAttribute("label",importaccounts[F].username);H.appendChild(D);var C=document.createElement("treecell");
  6. C.setAttribute("editable","false");C.setAttribute("label",importaccounts[F].password);H.appendChild(C);var A=document.createElement("treecell");A.setAttribute("value","true");H.appendChild(A);G.appendChild(H);B.appendChild(G)}return true}function SignonSelected(){var A=document.getElementById("signonsTree").view.selection.select(-1)
  7. }function TogglePasswordVisible(){if(!showingPasswords&&!ConfirmShowPasswords()){return}showingPasswords=!showingPasswords;LP.sr(document,"togglePasswords","label",(showingPasswords?"Hide Passwords":"Show Passwords"));document.getElementById("passwordCol").hidden=!showingPasswords}function AskUserShowPasswords(){return LP.lpConfirmYesNo(LP.lpgs("Are you sure you wish to show your passwords?"),window)
  8. }function ConfirmShowPasswords(){var C=Components.classes["@mozilla.org/security/pk11tokendb;1"].createInstance(Components.interfaces.nsIPK11TokenDB);var A=C.getInternalKeyToken();if(A.checkPassword("")){return AskUserShowPasswords()}try{A.login(true)}catch(B){}return A.isLoggedIn()}function cancel(){window.close()
  9. }function ImportSignons(){var B=document.getElementById("signonsTreeChildren");for(var C=B.childNodes.length-1;C>=0;C--){var D=B.childNodes[C];var E=D.childNodes[0];var A=E.childNodes[3];if(A.getAttribute("value")!="true"){importaccounts.splice(C,1)}}LP.lpSendFirefoxPasswordsToServer(importaccounts);
  10. window.close()}function SelectAllSignons(){var B=document.getElementById("signonsTreeChildren");for(var C=0;C<B.childNodes.length;C++){var D=B.childNodes[C];var E=D.childNodes[0];var A=E.childNodes[3];A.setAttribute("value","true")}}function UnselectAllSignons(){var B=document.getElementById("signonsTreeChildren");
  11. for(var C=0;C<B.childNodes.length;C++){var D=B.childNodes[C];var E=D.childNodes[0];var A=E.childNodes[3];A.setAttribute("value","false")}};
  12.